;;;Just set layer by selection
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://paracadd.com
;;;	All rights reserved.
;;;
(DEFUN C:JSL ()
  (setq loper "Set")
  (setq nent (nentsel))
  (setq blees (length(car(reverse nent))))
  (if nent
    (progn
      (if
        (>(length nent)2)
        (if
          (or(> blees 1)(=(cdr(assoc 8(entget(car nent))))"0"))
          (setq nentl (cdr(assoc 8(entget(caar(reverse nent))))))
          (setq nentl (cdr(assoc 8(entget(car nent)))))
        );if
        (setq nentl (cdr(assoc 8(entget(car nent)))))
      );if
      (setq lnlen (strlen nentl))
      (while (> lnlen 0)
        (if(eq(substr nentl lnlen 1)"|")
          (setq nentl (substr nentl (1+ lnlen))
                lmsg (strcat "\nSet current layer to " nentl ". ")
                lnlen 0
          );setq
          (setq lnlen (1- lnlen))
        );if
      );while
      (setq lmsg (strcat "\nLayer " nentl " has been made the current layer. "))
      (if (tblsearch "layer" nentl)
        (setvar "clayer" nentl)
        (command "_.layer" loper nentl "")
      )
      (princ lmsg)
    );progn
    (princ "\nNothing selected. ")
  );if nent
  (princ)
)